// 文章分类相关接口
import express from 'express'
import { getArtCates,addArtCate, deleteArtCate, getArtCate, updateArtCate } from '../router_handler/artcate.js'
import { addArtCate_schema, delArtCate_schema, putArtCate_schema } from '../schema/schema_artcate.js'
import expressjoi from '../utils/expressjoi.js'
const router = express.Router()
// 获取文章分类列表接口
router.get('/cates',getArtCates)
// 添加文章分类接口
router.post('/cates/add',expressjoi(addArtCate_schema),addArtCate)
// 删除文章分类接口
router.delete('/cates/delete/:id',expressjoi(delArtCate_schema),deleteArtCate)
// 根据id查找对应的文章分类数据
router.get('/cates/:id',expressjoi(delArtCate_schema),getArtCate)
// 根据id更新对应的文章分类数据
router.put('/cates/update',expressjoi(putArtCate_schema),updateArtCate)
export default router